efc8b08
@@ -150,6 +150,7 @@
private void runCycleAnalysisForPartitionPruning(OptimizeTezProcContext procCtx,
           LOG.info("Found cycle in operator plan...");
           cycleFree = false;
           removeEventOperator(component);
+          break;
         }
       }
       LOG.info("Cycle free: " + cycleFree);
@@ -227,7 +228,7 @@
private void connect(Operator<?> o, AtomicInteger index, Stack<Operator<?>> node
     for (Operator<?> child : children) {
       if (!indexes.containsKey(child)) {
         connect(child, index, nodes, indexes, lowLinks, components);
-        lowLinks.put(child, Math.min(lowLinks.get(o), lowLinks.get(child)));
+        lowLinks.put(o, Math.min(lowLinks.get(o), lowLinks.get(child)));
       } else if (nodes.contains(child)) {
         lowLinks.put(o, Math.min(lowLinks.get(o), indexes.get(child)));
       }
